home *** CD-ROM | disk | FTP | other *** search
/ AGA Toolkit '97 / The AGA Toolkit '97.iso / applications / kingfisher2 / versions.kfrx < prev   
Text File  |  1996-09-07  |  2KB  |  94 lines

  1. /* ARexx example for RexxFisher:
  2.  *
  3.  * Run this program while KFServer AND RexxFisher are running.
  4.  * I'M MAKING NO EFFORT TO ASSURE THAT THESE TWO ARE AVAILABLE.
  5.  *
  6.  * Written by:  Udo Schuermann
  7.  * $VER: Versions 1.0 (1.3.95)
  8.  *
  9.  * Displays the latest version of every software package in the
  10.  * database.  It does this by following the VersionLinks until
  11.  * there is no further link.  Creates a nice little table of
  12.  * programs along with release date (if any)
  13.  *
  14.  * NOTE: This script requires RexxFisher 1.10 or later because
  15.  * it does not use RF_ prefixes for keywords.
  16.  */
  17. options results
  18. address rexxfisher1
  19. /*
  20. if rc ~= 0 then do
  21.   say "Cannot find RexxFisher; is it running?"
  22.   exit 20
  23. end
  24. */
  25.  
  26. version
  27. say result
  28.  
  29. hello "VersionLink RexxFisher Demo"
  30. if rc ~= 0 then do
  31.   say rexxfisher.lasterror
  32.   exit 20
  33. end
  34.  
  35. obtain dbname
  36. dbname = result
  37. obtain dbfile
  38. dbfile = result
  39. obtain dbsize
  40. dbsize = result
  41. say dbname "("dbfile") with" dbsize "records:"
  42.  
  43. happy = 1
  44. rec = 1
  45. do while rec <= dbsize
  46.  
  47.   selectfish rec
  48.   obtain nver
  49.   nextrec = result
  50.  
  51.   if nextrec = 0 then
  52.     fish = rec
  53.   else
  54.     do while nextrec ~= 0
  55.       fish = nextrec
  56.       selectfish nextrec
  57.       obtain nver
  58.       nextrec = result
  59.     end
  60.  
  61.   getfish fish 75 "@{name}@{version|$VER=|}@{date|$DATE=|}@{author|$AUTH=|} \n"
  62.   text = result
  63.  
  64.   n = index(text,'$VER=')
  65.   if n > 0 then do
  66.     delstr(text,n,5)
  67.     if n < 30 then do
  68.       insert(copies(' ',30-n),text,n)
  69.     end
  70.   end
  71.  
  72.   n = index(text,'$DATE=')
  73.   if n > 0 then do
  74.     delstr(text,n,6)
  75.     if n < 40 then do
  76.       insert(copies(' ',40-n),text,n)
  77.     end
  78.   end
  79.  
  80.   n = index(text,'$AUTH=')
  81.   if n > 0 then do
  82.     delstr(text,n,6)
  83.     if n < 50 then do
  84.       insert(copies(' ',50-n),text,n)
  85.     end
  86.   end
  87.  
  88.   say text"        #"fish
  89.  
  90.   rec = rec + 1
  91. end
  92.  
  93. bye
  94.